package com.zhangxun.mapper;

import com.zhangxun.domain.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 张循
* @description 针对表【sys_user(系统用户)】的数据库操作Mapper
* @createDate 2022-12-28 17:28:20
* @Entity com.zhangxun.domain.SysUser
*/
public interface SysUserMapper extends BaseMapper<SysUser> {

    @Select("select t1.perms from sys_menu t1\n" +
            "left join sys_role_menu  t2 on t1.menu_id = t2.menu_id\n" +
            "left join sys_user_role t3 on t3.role_id = t2.role_id\n" +
            "where t3.user_id = #{userId} and t1.perms != ''")
    List<String> selectPermsById(Long userId);
}




